*****************************
* CONTENT OF THE REPOSITORY *
*****************************

This repository contains the  following files:

paper_data.dta  		- STATA data file containing the primary analysis dataset used in the paper (subject-level dataset)
chat.dta  			- STATA data file containing the chat analysis dataset analyzed in Section 4.3 (subject-level dataset)
coders_output.dta  	- STATA data file containing the classifications of the chat content made by two coders analyzed in Section 4.3
predictions.dta  		- STATA data file containing theoretical predictions used to plot Figure 5
RowData_*.xls 		- Excel data files containing the experimental raw data used in paper_data.dta (each file refers to one experimental session)
RowData_*.sbj 		- z-Tree data files containing the experimental raw data from the final questionnaire used in paper_data.dta (each file refers to one experimental session)
*_coder*.xls 		- Excel data files containing raw data used in coders_output.dta (one file for each treatment-coder)

stata_config.do 		- STATA do file that will install the required STATA packages if they are not already installed
gen_paper_data.do 	- STATA do file that will generate the dataset files paper_data.dta, chat.dta, coders_output.dta, and predictions.dta
stats_main.do 		- STATA do file that will generate all statistics reported in the main text
figs_main.do		- STATA do file that will generate all figures reported in the main text
tabs_main.do		- STATA do file that will generate all tables reported in the main text
stats_app.do 		- STATA do file that will generate all statistics reported in the online appendix
figs_app.do			- STATA do file that will generate all figures reported in the online appendix
tabs_app.do			- STATA do file that will generate all tables reported in the online appendix

1_*.ztt  			- z-Tree ztt file that will start Part 1 of each treatment (periods 1-5)
2_*.ztt  			- z-Tree ztt file that will start Part 2 of each treatment (periods 6-10)
3_*.ztt	  		- z-Tree ztt file that will start Part 3 of each treatment (periods 11-25)
4_questionnaire.ztq	- z-Tree ztt file that will start the final questionnaire


*******************************
* IMPLEMENTATION REQUIREMENTS *
*******************************

Software Requirements: 
- The analyses were implemented using STATA 17
- The experiment was run using z-Tree 3.6.7

Computational Requirements: Standard machines should have no difficulties in running the files.

Time Requirements: Total computation is ~3 min. All programs have negligible runtime.


*****************************************************
* DESCRIPTION OF VARIABLES IN THE ANALYSIS DATASETS *
*****************************************************

Within the paper_data.dta file there are 7,200 data rows across the 73 following variables:

1) treatment_id		- Ordinal variable indicating the treatment
					0   Baseline
					1   Decentralized
					2   Structured

2) economy_id		- Economy-specific identifier (it changes at period 11 when Part 3 begins) 

3) economy_type		- Ordinal variable indicating the composition of the economy in terms of teams' ideal points
					1   (L, M) in Parts 1 and 2
					2   (L, H) in Parts 1 and 2
					3   (M, H) in Parts 1 and 2
					0   (L, L, M, M, H, H) in Part 3

4) team_id			- Team-specific identifier

5) subject_id		- Subject-specific identifier

6) gstar			- Variable indicating the ideal point of the team (2; 6; 10)

7) gstar_opponent		- Variable indicating the ideal point of the opponent team (2; 6; 10); it is equal to missing in Part 3 under N=6

8) high_gstar		- Dummy variable equal to 1 if the team has the highest ideal point within the economy, and 0 otherwise

9) part			- Part number (1 to 3)

10) period			- Period number (1 to 25)

11) g_team			- Level of geoengineering effort implemented in a period by the team (0 to 15)

12) g				- Global geoengineering level within the economy in a period (sum of all g_team in the economy)

13) earnings_tot		- Total surplus in a period (sum of all teams' earnings within the economy in a period)

14) gini			- Gini index computed using the cumulate earnings of teams in the economy in the final period of each Part

15) offer_made		- Dummy variable indicating whether or not the team made an offer to another target team in a period
					0   Made no offer
					1   Made the offer
					.   The team was not allowed to make an offer (periods 1-5 of all treatments, periods 6-25 of Baseline, teams with lower ideal points in Structured)

16) offer_taken		- Dummy variable indicating whether or not the target team took the offer (from the point of view of the team who makes the offer)
					0   Targeted team rejected the offer
					1   Targeted team took the offer
					.   The team was not allowed to make an offer, or the team made no offer (offer_made=0)

17) transfers_sent	- Amount of tokens transferred with the side-payment (>0 if the offer made was taken by the target team; 0 if the offer was made but rejected; missing if no offer was made)

18) transfers_received	- Sum of all tokens obtained through all side-payments received (0=offer was received but rejected; .=no offer was received)

19) target_team		- Ordinal variable indicating the team targeted with the offer (target team)
				     1   Team L1 (only possible in Decentralized)
				     2   Team L2 (only possible in Decentralized; note: under N=2 all L teams are L1)
				     3   Team M1 (only possible in Decentralized or in Structured with N=2 in economy L,M)
				     4   Team M2 (only possible in Decentralized or in Structured with N=2 in economy L,M; note: under N=2 all M teams are M1)
				     5   Team H1 (only possible in Decentralized or in Structured with N=2 in economy L,H or M,H)
				     6   Team H2 (only possible in Decentralized or in Structured with N=2 in economy L,H or M,H; note: under N=2 all H teams are H1)
				     56  Team H1 and H2 jointly (only possible in Structured with N=6)

20) amount_team		- Amount of tokens offered to the target team (1 to 150 in Decentralized; 34 or 70 in Structured)

21) request_team		- Effort level requested to the target team in exchange for the amount (0 to 15 in Decentralized; 2 or 6 in Structured)

22) sign_team		- Ordinal variable indicating the sign of the request (Decentralized only)
				    -1   effort requested<request_team
				     0   effort requested=request_team
				     1   effort requested>request_team

23) amount_opponent	- Amount of tokens offered to the team by the opponent team in a period of Part 2 (1 to 150 in Decentralized; 34 or 70 in Structured)

24) request_opponent	- Effort level requested by the opponent team to the team in exchange for the amount in a period of Part 2 (1 to 150 in Decentralized; 34 or 70 in Structured)

25) sign_opponent		- Ordinal variable indicating the sign of the request of the opponent team in a period of Part 2 (Decentralized only)
				    -1   effort requested<request_opponent
				     0   effort requested=request_opponent
				     1   effort requested>request_opponent

26) g_own_1			- Level of geoengineering effort entered by the team member (same coding as g_team)

27) g_partner_1		- Level of geoengineering effort entered by the other team member

28) target_own_1		- Ordinal variable indicating the team targeted with the offer by the team member (same coding as target_team)

29) target_partner_1	- Ordinal variable indicating the team targeted with the offer by the other team member 

30) amount_own_1		- Amount of tokens offered to the target team by the team member (same coding as amount_team)

31) amount_partner_1  	- Amount of tokens offered to the target team by the other team member

32) request_own_1 	- Effort level requested to the target team in exchange for the amount by the team member (same coding as request_team)

33) request_partner_1 	- Effort level requested to the target team in exchange for the amount by the other team member

34) sign_own_1 		- Ordinal variable indicating the sign of the request specified by the team member (Decentralized only) (same coding as sign_team)

35) sign_partner_1 	- Ordinal variable indicating the sign of the request specified by the other team member (Decentralized only)

36-45) *_*_2		- Effort and/or offer variables indicating the values re-entered by the team member or other team member if there was any within-team disagreement on effort or offer variables (i.e. *_own_1!=*_partner_1)

46) risk			- Variable indicating the team member's answer to the final quiz question 1 on risk taking in the final quiz (0 to 10)

47) altruism1 		- Variable indicating the team member's answer to the final quiz question 2 on altruism (Falk et al. 2018) in the final quiz (0 to 1,000)

48) altruism2 		- Variable indicating the team member's answer to the final quiz question 3 on altruism (Falk et al. 2018) in the final quiz (0 to 10)

49) negrecip1 		- Variable indicating the team member's answer to the final quiz question 4 on negative reciprocity (Falk et al. 2018) in the final quiz (0 to 10)

50) negrecip2 		- Variable indicating the team member's answer to the final quiz question 5 on negative reciprocity (Falk et al. 2018) in the final quiz (0 to 10)

51) negrecip3 		- Variable indicating the team member's answer to the final quiz question 6 on negative reciprocity (Falk et al. 2018) in the final quiz (0 to 10)

52) posrecip1 		- Variable indicating the team member's answer to the final quiz question 7 on positive reciprocity (Falk et al. 2018) in the final quiz (0 to 10)

53) posrecip2		- Variable indicating the team member's answer to the final quiz question 8 on positive reciprocity (Falk et al. 2018) in the final quiz (1 to 7)

54-67) bad_quiz*		- Variables indicating whether or not the team member made a mistake in answering each control question 
					0   Correct response
					1   Wrong response

68-70) mistakes_pt*	- Variables indicating the number of questions in the quiz of each part where both team members gave the wrong answer

71) datetime		- Year-month-day-time of the experimental session

72) subject			- Subject identifier within the experimental session (1 to 25)

73) euros			- Variable indicating the final total earnings of a subject in EURs

*************************************************

Within the chat.dta file there are 31,191 data rows across the 11 following variables:

1) treatment_id 		- Ordinal variable indicating the treatment
					0   Baseline
					1   Decentralized
					2   Structured

2) economy_id 		- Economy-specific identifier (it changes at period 11 when Part 3 begins) 

3) team_id 			- Team-specific identifier

4) gstar			- Variable indicating the ideal point of the team (2; 6; 10)

5) part 			- Part number (1 to 3)

6) period 			- Period number (1 to 25)

7) effort_stage 		- Dummy variable equal to 1 if the chat belongs to the effort stage and equal to 0 if the chat belongs to the offer stage

8) time 			- Countdown for the chatting time

9) subject_id		- Subject-specific identifier	
		
10) text 			- Content of the chat by a team member in a given second (in Italian)

11) high_gstar		- Dummy variable equal to 1 if the team has the highest ideal point within the economy, and 0 otherwise

*************************************************

Within the coders_output.dta file there are 5,391 data rows across the 19 following variables:

1) coder_id			- Coder-specific identifier

2) treatment_id 		- Ordinal variable indicating the treatment
					0   Baseline
					1   Decentralized
					2   Structured

3) economy_id 		- Economy-specific identifier (it changes at period 11 when Part 3 begins) 

4) team_id 			- Team-specific identifier

5) gstar			- Variable indicating the ideal point of the team (2; 6; 10)

6) part 			- Part number (1 to 3)

7) period 			- Period number (1 to 25)

8) effort_stage 		- Dummy variable equal to 1 if the chat belongs to the effort stage and equal to 0 if the chat belongs to the offer stage

9) rowtot 			- Total number of categories attributed to the chat by the coder

10) confused_us		- Dummy variable equal to 1 if at least one of the two team members says s/he did not understand the instructions or claims that his/her teammate did not understand the instructions

11) confused_them		- Dummy variable equal to 1 if at least one of the two team members believes that the members of the other team(s) have not understood the rules of interaction

12) coordination		- Dummy variable equal to 1 if the team members have no doubts about the instructions but struggle to make a decision due to the difficulty of predicting the behavior of other teams, or team members struggle to make a decision and therefore decide not to make offers with the purpose of studying the behavior of other teams before taking action

13) difficult		- Dummy variable equal to 1 if the team members have no doubts about the instructions but struggle to make a decision due to some difficulty (calculation, for example)

14) prosocial		- Dummy variable equal to 1 if the team's final decision is explicitly aimed at harming the other teams, or the final decision of the team is aimed at punishing another team for the behavior it had in previous periods (even at the expense of their own earnings)

15) antisocial		- Dummy variable equal to 1 if the team's final decision is explicitly aimed at benefiting the other teams (even at the expense of their own earnings)

16) overconfident		- Dummy variable equal to 1 if team members have no doubts about instructions and are confident that they can predict the behavior of other teams and / or are confident about their actions (even though they might express frustration)

17) giveuppromises	- Dummy variable equal to 1 if the team members have lost faith in the effectiveness of offers (for example because they are rarely fulfilled) (Decentralized and Structured only) and this causes them not to make an offer or team members do not make an offer because they think they cannot make a difference in the dynamics of the game

18) disagree		- Dummy variable equal to 1 if team members openly disagree on the decision to make or not to make an offer (Decentralized and Structured only)

19) high_gstar		- Dummy variable equal to 1 if the team has the highest ideal point within the economy, and 0 otherwise


*********************************
* MAPPING OF PROGRAMS TO TABLES *
*********************************

Table 1	not empirical	
		
Table 2	tabs_main.do	lines: 8-105	output: decriptives.tex (layout adjusted manually)
		
Table 3	tabs_main.do	lines: 109-154	output: N/A (manually copied from Stata display)
		
Table D.1	tabs_app.do		lines: 17-113	output: ordereffects.tex (layout adjusted manually)

Table D.2	tabs_app.do		lines: 118-280	output: tab_app_effects_n6.tex (layout adjusted manually)

Table D.3	tabs_app.do		lines: 283-449	output: tab_app_effects_n2.tex (layout adjusted manually)

Table D.4	tabs_app.do		lines: 454-527	output: tab_app_avg_tests_byecon.tex (layout adjusted manually)

Table D.5	tabs_app.do		lines: 532-610	output: avg_tests_pt1vspt2.tex (layout adjusted manually)

Table D.6	not empirical
		
Table E.1	tabs_app.do		lines: 615-653	output: avg_tests_robcheck_struct.tex (layout adjusted manually)

Table E.2	tabs_app.do		lines: 658-749	output: effects_n6_robcheck_struct.tex (layout adjusted manually)

Table G.1	tabs_app.do		lines: 754-820	output: tab_app_efforts.tex (layout adjusted manually)

Table G.2	tabs_app.do		lines: 825-1020	output: tab_app_correlatesoffers.tex (layout adjusted manually)


**********************************
* MAPPING OF PROGRAMS TO FIGURES *
**********************************

Figure 1	figs_main.do	lines: 14-46	output: session.pdf (not empirical)

Figure 2	figs_main.do	lines: 50-85	output: g_hist_n6.pdf

Figure 3	figs_main.do	lines: 90-122	output: earnings_offers_n2.pdf (A); earnings_offers_n6.pdf (B)

Figure 4	figs_main.do	lines: 134-161	output: amount_round.pdf

Figure 5	figs_main.do	lines: 166-191	output: offers_type.pdf

Figure 6	figs_main.do	lines: 195-282	output: words_volume.pdf
			
Figure C.1	figs_apps.do	lines: 15-44	output: g_hist_n2.pdf
			
Figure C.2	figs_apps.do	lines: 49-81	output: g_rounds_n2.pdf (A); g_rounds_n6.pdf (B)
			
Figure C.3	figs_apps.do	lines: 86-99	output: g_rounds_decn2only.pdf
			
Figure C.4	figs_apps.do	lines: 104-153	output: effort_composition_n6.pdf (A); effort_composition_n2.pdf (B)
			
Figure C.5	figs_apps.do	lines: 158-176	output: profitableoffers_rounds.pdf
			
Figure E.1	figs_apps.do	lines: 181-220	output: offer_round_a_robcheck_structured.pdf (A); offer_round_b_robcheck_structured.pdf (B)
			
Figure F.1	figs_apps.do	lines: 225-263	output: disagreement_effort.pdf (A); disagreement_offer.pdf (B)
			
Figure G.1	figs_apps.do	lines: 267-283	output: mistakes_team.pdf

Figure H.2	figs_apps.do	lines: 286-313	output: chat_content.pdf (manually edited from gph file)


***************************
* ANALYSES IMPLEMENTATION *
***************************

To generate the analysis dataset and replicate all analyses take the following actions: 
1. Create one subfolder named "data" and place all sbj, dta, and xls files in it
2. Create one subfolder named "do" and place all STATA do-files in it
3. Create two empty subfolder named "figs" and "tabs"; figures and tables gererated with the analyses do-files will be saved in these folders.
4. Run stata_config.do 
5. Run gen_paper_datasets.do (requires the manual installation of ztree2stata: https://sites.google.com/view/takekan/research/ztree2stata) 
6. Run in any order stats_main.do, figs_main.do, tabs_main.do, stats_app.do, figs_app.do, tabs_app.do
 

*************************
* Z-TREE IMPLEMENTATION *
*************************

The layout of the experiment is in Italian. 
To implement the experiment with z-Tree run the files in the folder "zTree" in the following order:
1. 1_*.ztt (treatment specific; implements part 1 of the experiment)
2. 2_*.ztt (treatment specific; implements part 2 of the experiment)
3. 3_*.ztt (treatment specific; implements part 3 of the experiment)
4. 4_questionnaire.ztt (implements the final questionnaire)